new Vue({
    el: "#app",
    data: {
        newGoodsList: []
    },
    methods: {
        findNewGoods: function () {
            axios({
                url: "/home/findNewGoods"
            }).then(res => {
                if (res.data.flag) {
                    this.newGoodsList = res.data.data;
                }
            });
        },
        toDetail: function (goodsId) {
            sessionStorage.setItem("goodsId", goodsId);
            location.href = "goodsDetail.html"
        }
    },
    created: function () {
        this.findNewGoods();
    }
})